package test.src.内部类与异常类;

interface SpeakHello {
    void speak();
}

class HelloMachine {
    public void turnOn(speakHello hello) {
        hello.speak();
    }
}

public class Example7_3 {
    public static void main(String[] args) {
        HelloMachine machine = new HelloMachine();
        machine.turnOn(new speakHello() {
            @Override
            public void speak() {
                System.out.println("hello, you are welcome");
            }
        });
        machine.turnOn(new speakHello() {
            @Override
            public void speak() {
                System.out.println("您好，欢迎光临。");
            }
        });
    }
}
